package com.hsmpay.mobile.dao.user;

import com.hsmpay.common.dao.BaseDao;
import com.hsmpay.mobile.pojo.user.UserMoney;

import java.io.Serializable;
import java.sql.SQLException;

/**
 * 用户虚拟货币 Dao接口
 *
 * @param <Entity>
 * @param <Query>
 * @author 颜铃璋
 *         建立时间：2013-1-21
 */
public interface UserMoneyDao<Entity extends Serializable, Query extends Object> extends BaseDao<Entity, Query> {
    /**
     * 通过userId 修改用户虚拟货币
     *
     * @param userMoney
     * @return
     * @throws SQLException
     */
    public int updateUserMoneyByUserId(UserMoney userMoney) throws SQLException;

    /**
     * 通过userId 修改用户虚拟货币
     *
     * @param userId
     * @param money
     * @return
     * @throws SQLException
     */
    public int updateUserMoneyByUserId(Long userId, Double money) throws SQLException;

    /**
     * 通过userId 修改用户 可用金额
     *
     * @param userId
     * @param money
     * @return
     * @throws SQLException
     */
    public int updateAvailMoneyByUserId(Long userId, Double availMoney) throws SQLException;

    /**
     * 通过userId 查询用户虚拟货币
     *
     * @param userId
     * @return
     * @throws SQLException
     */
    public UserMoney searchUserMoneyByUserId(Long userId) throws SQLException;
}
